﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Traceability.App.Application;
using Traceability.App.Application.Dto.Input;
using Traceability.App.Domain.Model;
using Traceability.App.ErrorCode;

namespace Traceability.App.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CompanyController : ControllerBase
    {
        private readonly IService _service;
        public CompanyController(IService service)
        {
            _service = service;
        }
        /// <summary>
        /// 添加/修改养殖企业信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public ApiResult<int> AddCultivation(CultivationInput input) 
        {
            return _service.AddCultivation(input);
        }
        /// <summary>
        /// 获取养殖企业信息
        /// </summary>
        /// <param name="batch"></param>
        /// <returns></returns>
        [HttpGet]
        public ApiResult<List<Cultivation_TableModel>> GetCultivationTableShow(string batch) 
        {
            return _service.GetCultivationTableShow(batch);
        }
    }
}
